updating oE abort
abort
<built-in> procedure abort(atom error)
aborts execution of the program.
Parameters:
- error : an integer, the exit code to return.
Comments:
error is expected to lie in the 0..255 range. Zero is usually interpreted as the sign of a successful completion.
Other values can indicate various kinds of errors. Windows batch (.bat) programs can read this value using the errorlevel feature. Non integer values are rounded down. A Euphoria program can read this value using system_exec.
abort is useful when a program is many levels deep in subroutine calls, and execution must end immediately, perhaps due to a severe error that has been detected.
If you do not use abort then the interpreter will normally return an exit status code of zero. If your program fails with a Euphoria-detected compile-time or run-time error then a code of one is returned.
Example 1:
if x = 0 then puts(ERR, "can't divide by 0 !!!\n") abort(1) else z = y / x end if
See Also:
Not Categorized, Please Help
|